package zmee.pur.tnd.formplugin;

import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.form.IFormView;

import java.util.EventObject;

/**
 * @Author: xw
 * @Date: 2022/11/11/14:51
 * @Description: 答疑截止时间 变更处理
 */
public class ReplydateChangeEditPlugin extends AbstractBillPlugIn {

    @Override
    public void beforeBindData(EventObject e) {
        super.afterBindData(e);
        IFormView parentView = this.getView().getParentView();
        if (parentView != null) {
            String billstatus = parentView.getModel().getDataEntity().getString("billstatus");
            if (billstatus == null || "".equals(billstatus) || "A".equals(billstatus)) {
                DynamicObject projectObj = parentView.getModel().getDataEntity().getDynamicObject("project");
                this.getModel().setValue("replydate", projectObj.getDate("answerdate"));
            }
        }
    }
}
